package com.yict.common.service;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import com.yict.common.dao.IBaseDao;
import com.yict.common.entity.PageEntity;

public interface IBaseService<T, PK extends Serializable,D extends IBaseDao<T,PK>> {
	
	public boolean save(T t) throws Exception;

	public boolean update(T t) throws Exception;

	public boolean remove(T t) throws Exception;
	
	public boolean remove(PK id) throws Exception;
	
	public boolean remove(PK[] ids) throws Exception;

	public T findById(PK id);
	
	public List<T> list(Map<String, Object> queryMap,
			PageEntity page, LinkedHashMap<String,Boolean> orderList);
	
	/**
	 * 根据单个属性查找
	 * @param value
	 * @param propertyName
	 * @return
	 */
	public List<T> listByProperty(Object value,String propertyName);
	
	/**
	 * 根据属性查找唯一记录
	 * @param value
	 * @param propertyName
	 * @return
	 * @throws Exception
	 */
	public T findByUnique(Object value,String propertyName);
}
